
const { ethers } = require("hardhat");
const { expect } = require("chai");
const inputArray=[1,6,3,7,4];//给出未排序数值
const expectArray=[1,3,4,6,7];//给出期望的数组
var insertContract;
describe("Bubbling",function(){
    
    it("deploy is success",async function(){
        const InsertContract=await ethers.getContractFactory("Insert");
        
        insertContract=await InsertContract.deploy();
       
    })
    it("sort is success",async function(){
        await insertContract.sortArray(inputArray);
        expect(inputArray).not.to.equal(await insertContract.getArray());
    })
    it("answe is check",async function(){
        var sortedArray=await insertContract.getArray();
        expect(expectArray).to.deep.equal(sortedArray);
    })
});

